package com.vhuan.self_discipline_service.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class AbstractFocusBaseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)    // 指定主键生成策略
    private Long id;

    @JsonFormat(timezone = "${pattern.timezone}",pattern = "${pattern.dateformat}")
    @DateTimeFormat(pattern = "${pattern.dateformat}")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonFormat(timezone = "${pattern.timezone}",pattern = "${pattern.dateformat}")
    @DateTimeFormat(pattern = "${pattern.dateformat}")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    private int version;


    @TableField(value = "is_deleted")
    private int deleteFlag;

}
